Open topic with navigation
You are here: Replication > Inserting tasks during replication
Inserting tasks during replication
Task command processing is a Double-Take Availability feature that allows you to insert and run tasks at various points during the replication of data. Because the tasks are user-defined, you can achieve a wide variety of goals with this feature. For example, you might insert a task to create a snapshot or run a backup on the target after a certain segment of data from the source has been applied on the target. This allows you to coordinate a point-in-time backup with real-time replication.
Task command processing can be enabled from the Replication Console, but it can only be initiated through a scripting command.
If you disable this option on a source server, you can still submit tasks to be processed on a target, although task command processing must be enabled on the target.
Because Double-Take Availability replication follows the same write sequence within and across multiple files, it provides complete data integrity at all times. At any given moment, the target represents a single point in time from the source, which makes the target crash consistent. But for some applications, crash consistency may not be adequate. You may require that the source data be in a quiescent (latent) state, similar to an application checkpoint. You need to be able to identify when the application is stable, which is usually when all of the data has been written to disk. This can be triggered by stopping the service. With task command processing, you can stop the source service just long enough to identify that stopped point in time as a stable state, insert a task at that point into the Double-Take Availability replication queue to trigger a backup or snapshot on the target, and then restart the service. Here is how the process would work.
- Double-Take Availability and an application are both running on the source. Only Double-Take Availability is running on the target.
- The application data is changing on the source and Double-Take Availability is capturing those data changes and transmitting them to the target.
- A script is launched (either manually or perhaps scheduled by the Windows Scheduler) that stops the application service on the source, pauses to give the service time to shutdown and write the data to disk, initiates a Double-Take Availability task command, and then restarts the application service on the source.
- The Double-Take Availability task command is transmitted, inline with the source replication data, to the target.
- The data is applied on the target as it is received. Since the task command was inserted inline, the replication data from the source is applied to the target first. When the target gets to the Double-Take Availability task command, the target data will be in the exact same state as the source data when the source application service was stopped. Since this was a stable point on the source, it is also a stable point on the target.
- The target processes the Double-Take Availability task command and completes whatever task is defined, perhaps a snapshot or backup. Since the Double-Take Availability task command is user-defined, you can insert any valid executable or batch file.
Double-Take Availability task command processing must be enabled, and there must be an active Double-Take Availability connection for task command processing to function properly. To insert a task command, you would use the
queuetask command.
Command
QUEUETASK
Description
Queues tasks inline with replication data
Syntax
QueueTASK <job_name> TO <target> ONQueue = <task> [args]
| ONTRANSmit = <task> [args] | ONRECeive = <task> [args] | ONEXECute = <task> [args] [TIMEOUT = <timeout>]
[INTERACT | NOINTERACT]
Options
- job_name—Unique job name assigned to this task. This will be the identifier you see in the log files.
- target—Name of the target, an IP address on the target, or a virtual IP address. Depending on the network route Double-Take Availability uses to access the target, you may need to specify the fully qualified domain name. The target is required even if you are only queuing a task to be executed on the source.
- ONQueue—Execute the specified task on the source machine as soon as the source receives and queues the task. During heavy replication, there may be a delay while the task is queued inline with the replication operations.
- ONTRANSmit—Execute the specified task on the source machine just before the source transmits the task to the target.
- ONRECeive—Execute the specified task on the target machine as soon as the target receives and queues the task.
- ONEXECute—Execute the specified task on the target when the target processes the task from the queue. Since the task is not executed until it is processed, if the target is paused, the task will be held in queue.
- task—The path and filename of the task to run relative to the machine it will be run on. Tasks include any valid executable or batch file. The executables or files must exist in the specified location on the machine where they will be executed
- args—Arguments or options which need to be supplied with the task. Multiple arguments can be supplied in a space-separated list enclosed in quotation marks.
- TIMEOUT timeout—Valid number followed by an optional time indicator indicating the length of time ot pause while waiting for the task to complete. The valid time indicators include seconds, minutes, hours, and days. If you do not specify a time indicator, it will default to seconds. The number zero (0) indicates there is no timeout delay and the next operation is immediately processed. The keyword FOREVER indicates that the next operation is not processed until the task has completed execution. If you do not specify this option, the timeout will default to forever.
- INTERACT—Tasks interact with the desktop and, therefore, display on screen and run in the foreground
- NOINTERACT—Tasks do not interact with the desktop
Examples
- queuetask backup to beta onreceive=PauseAndBackup.bat onexecute=Resume.bat
- qtask backup to beta onrec=PauseAndBackup.bat onexec=resume.bat
Notes
- The default setting for this command is nointeract.
- Any combination of one or more execution points can be used with the same queuetask command.
- All script processing messages, including errors, can be viewed in the Double-Take Availability logs and the Windows Event Viewer.
- Onqueue will still execute as soon as the task is placed on the queue even if transmission is stopped (manually stopped or paused, unmet scheduled transmission criteria, etc.). Any other option will not execute until transmission is restarted.
- If your source is in a restore required state, any task placed on the queue will be executed immediately. Use caution when submitting tasks while in this state so that the target does not get inadvertently updated.
- A task may be discarded if all connections to a target are manually disconnected, replication is stopped for all connections to a target, or an auto-disconnect occurs.
- If a task is submitted after replication is stopped, the task will be executed immediately.
- If you disable task command processing while tasks are in queue, those tasks will not be executed.
- The user submitting the task command must be a member of the Double-Take Admin security group on both the source and target and the Double-Take service must have proper privileges to access the files or run the commands specified in the task.
- Options that contain non-alphanumeric characters must be enclosed in quotation marks.
Related Topics